package com.liuwei.assemble.common;

/**
 * API错误码枚举
 *
 * @author wendfan
 */
public enum ResultCode {

    SUCCESS(20000, "操作成功"),
    LOGIN_ERROR(30001, "登陆失败"),
    ILLEGAL_USER_PASSWORD(30002, "用户名密码异常"),
    ILLEGAL_TOKEN(30004, "TOKEN 异常"),
    UN_PERMISSION(30005, "权限异常"),
    SYSTEM_ERROR(40000, "系统异常"),
    INTERFACE_ERROR(40001, "接口异常"),
    DATABASE_ERROR(40002, "数据库异常"),
    IO_ERROR(40003, "IO异常");

    private int code;
    private String message;

    private ResultCode(int code, String message) {
        this.code = code;
        this.message = (message != null ? message : "");
    }

    public int getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }
}
